<template>
  <div class="">
    <div>childC setter 的数据： {{ $store.state.setter.id }}</div>
    <div>{{ age }}</div>
    <div>{{ id }}</div>
    <div>{{ $store.getters.setterId }}</div>
    <div> good</div>

<button @click='changeId'>click</button>
<button @click='asyncId'>click</button>
    <div>{{filterId}}</div>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";

const {
  mapState,
  mapGetters,
  mapActions,
  mapMutations
} = createNamespacedHelpers("setter");

export default {
  name: "",
  data() {
    return {};
  },
  watch: {},
  props: {},
  components: {},
  computed: {
    /* ...mapState({
      age: state => {
        // console.log(state);
        return state.age;
      },
      id: state => {
        // console.log(state);
        return state.id;
      },
    }) */

    ...mapState(['age','id']),
    ...mapGetters(['filterId'])
  },
  mounted() {},
  methods: {
    ...mapMutations(['changeId']),
    ...mapActions(['asyncId'])

  },
  filters: {}
};
</script>

<style scoped lang="css"></style>
